{{template "header" .}}

<!-- Breadcrumb -->
<ol class="breadcrumb">
  <li class="breadcrumb-item"><a>Home</a></li>
  <li class="breadcrumb-item active">Nodes</li>
</ol>

<div class="container">
  <div class="card">
    <div class="card-body">
      <div class="row">
        <div class="col-md-12">
          <h3 class="card-title">Nodes</h3>
          <table class="table">
            <thead>
              <tr>
                <th>Id</th>
                <th>Hostname</th>
                <th>Cpu</th>
                <th>Memory</th>
                <th>IOMMU</th>
                <th></th>
              </tr>
            </thead>
            <tbody>
              {{ range .Nodes }}
              <tr>
                <td><a href="{{ Url "node-detail" "id" .Id }}">{{ .Id }}</a></td>
                <td>{{ .Hostname }}</td>
                <td>{{ .CpuInfo }}</td>
                <td>{{ .Memory.Bytes | HumanizeBytes }}</td>
                <td>{{ .Iommu }}</td>
                <th>
                  <a title="Volumes" href="{{ Url "volume-list" }}?node={{ .Id }}">V</a> |
                  <a title="Virtual Machines" href="{{ Url "virtual-machine-list" }}?node={{ .Id }}">M</a>
                </th>
              </tr>
              {{ end }}
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
  {{/*
  <!-- <div class="row">
    <div class="col-md-12">
      <div class="card">
        <div class="card-body">
          <div class="row">
            <div class="col-md-12">
              <h3 class="card-title">{{ .HostInfo.Hostname }}</h3>
              <div class="small text-muted" style="margin-top:-10px;">
                {{ .HostInfo.CpuVendor }} {{ .HostInfo.CpuModel }} {{ .HostInfo.CpuArch }}<br>
                IOMMU {{ if .HostInfo.Iommu }}enabled{{ else }}disabled{{ end }}
              </div>
            </div>
            <div class="col-md-12 mt-5">
              <h5>CPU Info</h5>
              <table class="table">
                <thead class="thead-light">
                  <tr>
                    <th>NumaId</th>
                    <th>Cores</th>
                    <th>Memory</th>
                    <th>Pages 4k</th>
                    <th>Pages 2M</th>
                    <th>Pages 1G</th>
                  </tr>
                </thead>
                <tbody>
                  {{ range $numaId, $numa := .HostInfo.Numas }}
                  <tr>
                    <td>{{ $numaId }}</td>
                    <td>{{ len $numa.Cores }}</td>
                    <td>{{ $numa.Memory.Bytes | HumanizeBytes }}</td>
                    <td>{{ $numa.Pages4k }}</td>
                    <td>{{ $numa.Pages2m }}</td>
                    <td>{{ $numa.Pages1g }}</td>
                  </tr>
                  {{ end }}
                </tbody>
              </table>
            </div>

            <div class="col-md-12">
              <h5>Volume Pools</h5>
              <table class="table">
                <thead class="thead-light">
                  <tr>
                    <th>Name</th>
                    <th>Free</th>
                    <th>Size</th>
                    <th>Allocation</th>
                  </tr>
                </thead>
                <tbody>
                  {{ range .VolumePools }}
                  <tr>
                    <td>{{ .Name }}</td>
                    <td>{{ .Free.Bytes | HumanizeBytes }}</td>
                    <td>{{ .Size.Bytes | HumanizeBytes }}</td>
                    <td>{{ .UsagePercent }}%</td>
                  </tr>
                  {{ end }}
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div> -->
  */}}
</div>

{{template "footer" .}}
